package com.sxl.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;

/**
 * 
 * @TableName roles
 */
@TableName(value ="roles")
@Data
public class Roles implements Serializable {
    /**
     * 用户组编号
     */
    @TableId(value = "Id", type = IdType.AUTO)
    private Integer id;

    /**
     * 角色（用户组）名称
     */
    @TableField(value = "Name")
    private String name;

    /**
     * 预留Int
     */
    @TableField(value = "Int0")
    private Integer int0;

    /**
     * 预留字符串
     */
    @TableField(value = "String0")
    private String string0;
    @TableField(exist = false)
    private int page;

    @TableField(exist = false)
    private int limit;

    public int getPage() {
        return (page-1)*limit;
    }
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /**
     * 用户组编号
     */
    public Integer getId() {
        return id;
    }

    /**
     * 用户组编号
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * 角色（用户组）名称
     */
    public String getName() {
        return name;
    }

    /**
     * 角色（用户组）名称
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * 预留Int
     */
    public Integer getInt0() {
        return int0;
    }

    /**
     * 预留Int
     */
    public void setInt0(Integer int0) {
        this.int0 = int0;
    }

    /**
     * 预留字符串
     */
    public String getString0() {
        return string0;
    }

    /**
     * 预留字符串
     */
    public void setString0(String string0) {
        this.string0 = string0;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Roles other = (Roles) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
            && (this.getInt0() == null ? other.getInt0() == null : this.getInt0().equals(other.getInt0()))
            && (this.getString0() == null ? other.getString0() == null : this.getString0().equals(other.getString0()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getInt0() == null) ? 0 : getInt0().hashCode());
        result = prime * result + ((getString0() == null) ? 0 : getString0().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", name=").append(name);
        sb.append(", int0=").append(int0);
        sb.append(", string0=").append(string0);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}